package com.cangxuan.manage.dao;

import com.cangxuan.manage.entity.Order;
import com.cangxuan.manage.entity.Registration;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
/**
 * 订单Dao
 * 作者：游星宇
 * 一级市场订单
 * 二级市场订单
 */
@Mapper
public interface IOrderDao {
 /*   List<Order> select1(@Param("name") String name,
                       @Param("orderformStateName") String orderformStateName,
                       @Param("buyerId") Integer buyerId);

    List<Order> select2(@Param("name") String name,
                        @Param("orderformStateName") String orderformStateName,
                        @Param("sellerId") Integer sellerId,
                        @Param("buyerId") Integer buyerId);*/



    List<Order> selectaFy1(@Param("pageIndex") int pageIndex,
                                  @Param("pageSize") int pageSize,
                                  @Param("name") String name,
                                  @Param("orderformStateName") String orderformStateName,
                                  @Param("buyerId") Integer userId);
    int selectCount1( @Param("name") String name,
                     @Param("orderformStateName") String orderformStateName,
                     @Param("buyerId") Integer userId);
    List<Order> selectaFy2(@Param("pageIndex") int pageIndex,
                           @Param("pageSize") int pageSize,
                           @Param("name") String name,
                           @Param("orderformStateName") String orderformStateName,
                           @Param("sellerId") Integer sellerId,
                           @Param("buyerId") Integer buyerId);
    int selectCount2( @Param("name") String name,
                      @Param("orderformStateName") String orderformStateName,
                      @Param("sellerId") Integer sellerId,
                      @Param("buyerId") Integer buyerId);


    @Select("select count(0) from orderform where goods_id=#{goodsId}")
    int selectCount(@Param("goodsId") int goodsId);

}
